home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Network Support Library
/
RoseWare - Network Support Library.iso
/
apidev
/
dax1.exe
/
DAP
/
DAP014.C
< prev
next >
Wrap
Text File
|
1992-07-15
|
4KB
|
104 lines
// ╔════════════════════════════════════════════════════════════════════╗
// ║ ║
// ║ module: dap014.c ║
// ║ abstract: This module contains DAP request 1014 ║
// ║ ║
// ║ environment: NetWare 3.x v3.11 ║
// ║ Network C for NLMs SDK ║
// ║ CLib v3.11 ║
// ║ Network C for DOS v2.0 ║
// ║ NetWare C Interface DOS v1.2 ║
// ║ ║
// ║ This software is provided as is and carries no warranty ║
// ║ whatsoever. Novell disclaims and excludes any and all implied ║
// ║ warranties of merchantability, title and fitness for a particular ║
// ║ purpose. Novell does not warrant that the software will satisfy ║
// ║ your requirements or that the software is without defect or error ║
// ║ or that operation of the software will be uninterrupted. You are ║
// ║ using the software at your risk. The software is not a product ║
// ║ of Novell, Inc. or any of subsidiaries. ║
// ║ ║
// ╟────────────────────────────────────────────────────────────────────╢
// ║ maintenance history: ║
// ║ level date pi description ║
// ╟────────────────────────────────────────────────────────────────────╢
// ║ 001 02/21/92 kl initial release. ║
// ╚════════════════════════════════════════════════════════════════════╝
#include "dap/dapsys.h"
//
// The following are the request/reply structures for the mulOperands
// DAP.
//
typedef struct{ // mul operands request pkt
SINT32 operand1; // operand1
SINT32 operand2; // operand2
}MORequest;
typedef struct{ // mul operands reply pkt
SINT32 result; // the result
}MOReply;
#if !defined(ENGINE)
//
// Following is the Client-Side API for mulOperands
//
// DAPid - this is obtained from DAPInitialize. It is
// normally a pointer to some sort of structure
// containing info needed to connect to the server.
// op1 - the first operand to mul
// op2 - the second operand to mul
//
T_RC DAPMultiplyOperands(DAPDATA *DAPid,long op1, long op2, long *result)
{
T_RC rc;
MORequest *request = (MORequest *)DAPid->dapRequest.data;
MOReply *reply = (MOReply *)DAPid->dapReply.data;
//
// fill in the request structure
//
request->operand1 = op1;
request->operand2 = op2;
//
// Send the request
//
if( (rc = DAPSendRequest(DAPid,DAPMULTIPLYOPERANDS)) == 0){
//
// Copy result
//
*result = reply->result;
}
return rc;
}
#else // !defined(ENGINE)
//
// Following is the Server-Side API for mulOperands
//
void DAPMultiplyOperands(DAPDATA *DAPid)
{
MORequest *request = (MORequest *)DAPid->dapRequest.data;
MOReply *reply = (MOReply *)DAPid->dapReply.data;
DIAG4("Inside MultiplyOperands DAP");
//
// Do the work
//
reply->result = request->operand1 * request->operand2;
//
// Set the DAP return code
//
DAPid->dapReply.returnCode = 0;
//
// Now send the result to the client
//
DAPEnqueueServiceReply(DAPid);
}
#endif // !defined(ENGINE)